package com.kqb.controller;


import com.kqb.common.controller.base.BaseController;
import com.kqb.common.domain.AjaxResult;
import com.kqb.pojo.CustomerInquiry;
import com.kqb.pojo.dto.InquiryQueryDto;
import com.kqb.service.ICustomerInquiryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 杉果树皮
 * @date 2025/2/25 16:58
 * @description:
 */
@RestController
@RequestMapping("/api")
@Api(tags = "客户询价")
public class CustomerInquiryController extends BaseController {
    @Autowired
    private ICustomerInquiryService inquiryService;

    @PostMapping("/customerInquiry")
    @ApiOperation("添加询价单")
    public AjaxResult save(@RequestBody CustomerInquiry customerInquiry) {
        return inquiryService.save(customerInquiry);
    }

    @GetMapping("/customerInquiry/all")
    @ApiOperation("查询询价单")
    public AjaxResult selectAll(InquiryQueryDto inquiryQueryDto) {
        return inquiryService.select(inquiryQueryDto);
    }

    @GetMapping("customerInquiry")
    @ApiOperation("更新询价单状态")
    public AjaxResult updateStatus(int id) {
        return inquiryService.updateStatus(id);
    }

    @GetMapping("/customerInquiryDetail/{id}")
    @ApiOperation("根据询价单id查询询价单详情")
    public AjaxResult selectByInquiryId(@PathVariable("id") int id) {
        return inquiryService.selectByInquiryId(id);
    }





}
